<include file="Public:header" />
<style>
    .search-form span{font-size:13px;padding:0 6px;}
    .search-form span:first-child{padding-left:0;}
    .search-form span:last-child{padding-right:0;}
    .search-form input{font-size:13px;}
    .search-form select{font-size:13px;}
</style>
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>小程序订单列表</h3></div>
                <div class="fr">
                    <div class="fr form-search-count">
                        <span class="offset">({$page.from}-{$page.to})</span>
                        <span class="total">共{$page.total}条</span>
                        <button onclick="PageJump({$page.prevPage});" class="btn-normal">上一页</button>
                        <button onclick="PageJump({$page.nextPage});" class="btn-normal">下一页</button>
                    </div>
                </div>
            </div>
            <div class="line2">
                <div class="fl form-btn-group">
                    <form id="search-form" class="search-form" method="post" action="">
                        <span>申请时间:</span>
                        <input name="ctime1" onclick="laydate({istime: true,format:'YYYY/MM/DD hh:mm'})" style="width:100px;" value="{$where[ctime][1][0]}" type="text" />
                        <span>至</span>
                        <input name="ctime2" onclick="laydate({istime: true,format:'YYYY/MM/DD hh:mm'})" style="width:100px;" value="{$where[ctime][1][1]}" type="text" />
                        <span>终端类型:</span>
                        <select name="client">
                            <option value="all">全部</option>
                            <option <if condition="$where.client eq pc">selected="selected"</if> value="pc">PC</option>
                            <option <if condition="$where.client eq wap">selected="selected"</if> value="wap">WAP</option>
                        </select>
                        <span>支付方式:</span>
                        <select name="type">
                            <option value="all">全部</option>
                            <option <if condition="$where.type eq weixin">selected="selected"</if> value="weixin">微信</option>
                            <option <if condition="$where.type eq alipay">selected="selected"</if> value="alipay">支付宝</option>
                        </select>
                        <span>申请类型:</span>
                        <select name="service" style="width: 120px;">
                            <option value="all">全部</option>
                            <volist name="service" id="vo">
                                <option <if condition="$where[service] eq $vo[name]">selected="selected"</if> value="{$vo.name}">{$vo.name}</option>
                            </volist>
                        </select>
                        <span>付款状态:</span>
                        <select name="state">
                            <option value="all">全部</option>
                            <option <if condition="$where.state eq '未支付'">selected="selected"</if> value="未支付">未支付</option>
                            <option <if condition="$where.state eq '已支付'">selected="selected"</if> value="已支付">已支付</option>
                        </select>
                        <select name="option" style="width:100px;">
                            <option <if condition="$condition.field eq name">selected="selected"</if> value="name">申请人姓名</option>
                            <option <if condition="$condition.field eq phone">selected="selected"</if> value="phone">申请人电话</option>
                            <option <if condition="$condition.field eq qq">selected="selected"</if> value="qq">申请人QQ</option>
                            <option <if condition="$condition.field eq address">selected="selected"</if> value="address">所在地区</option>
                            <option <if condition="$condition.field eq wxgzh">selected="selected"</if> value="wxgzh">公众号名称</option>
                            <option <if condition="$condition.field eq money">selected="selected"</if> value="money">付款金额</option>
                            <option <if condition="$condition.field eq no">selected="selected"</if> value="no">订单号</option>
                            <option <if condition="$condition.field eq payid">selected="selected"</if> value="payid">支付单号</option>
                            <option <if condition="$condition.field eq refer">selected="selected"</if> value="refer">域名</option>
                        </select>
                        <input name="keyword" placeholder="请输入搜索关键字" style="width:100px;"
                               value="{$condition.value}" type="text" />
                        <input name="page" value="{$filter.page}" type="hidden" />
                        <input name="order_field" value="{$filter.order_field}" type="hidden" />
                        <input name="order_sort" value="{$filter.order_sort}" type="hidden" />
                        <button class="btn-normal" type="submit">查 询</button>
                        <button class="btn-normal" onclick="action_export();" type="button">导 出</button>
                    </form>
                </div>
                <div class="fl form-btn-more" style="display: none;">
                    <button class="btn-normal btn-more">更多操作<i class="drop-down"></i></button>
                    <ul class="more-action hidden">
                        <in name="$x|default='01-01-02'" value="$rightsCode">
                            <li><a onclick="action_export();" href="javascript:void(0);">导 出</a></li>
                            <li><a onclick="action_del();" href="javascript:void(0);">删 除</a></li>
                        </in>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="scroll-box" style="z-index:-1;">
        <div class="scroll-table">
            <!--If you don't need header background color you don't need this div.-->
            <div class="header-hack"></div>
            <div class="thead">
                <div class="thead-line">
                    <div class="checkbox"><input name="select-all" type="checkbox" />&nbsp;</div>
                    <div field="id">ID</div>
                    <div field="refer">域名</div>
                    <div field="no">订单号</div>
                    <div field="wxgzh">公众号名称</div>
                    <div field="name">申请人姓名</div>
                    <div field="phone">联系手机</div>
                    <div field="qq">QQ</div>
                    <div field="province">所在地区</div>
                    <div field="purpose">申请用途</div>
                    <div field="service">申请类型</div>
                    <div field="client">终端类型</div>
                    <div field="money">付款金额</div>
                    <div field="state">是否付款</div>
                    <div field="type">支付方式</div>
                    <div field="payid">支付单号</div>
                    <div field="ctime">申请时间</div>
                </div>
            </div>
            <div class="tbody">
                <volist name="list" id="vo" key="index">
                <div class="tbody-line" offset="{$vo.offset}" <if condition='$vo.state eq 已支付'>style="color:green;font-weight:bold;"</if> data-id="{$vo.id}">
                    <div class="checkbox"><input name="checkbox" data-id="{$vo.id}" type="checkbox" />&nbsp;</div>
                    <div field="id">{$vo.id}</div>
                    <div field="refer">{$vo.refer}</div>
                    <div field="no">{$vo.no}</div>
                    <div field="wxgzh">{$vo.wxgzh}</div>
                    <div field="name">{$vo.name}</div>
                    <div field="phone">{$vo.phone}</div>
                    <div field="qq">{$vo.qq}</div>
                    <div field="province">{$vo.province}-{$vo.city}-{$vo.area}</div>
                    <div field="purpose">{$vo.purpose}</div>
                    <div field="service">{$vo.service}</div>
                    <div field="client">{$vo.client}</div>
                    <div field="money">{$vo.money}</div>
                    <div field="state">{$vo.state}</div>
                    <div field="type">{$vo.type}</div>
                    <div field="payid">{$vo.payid}</div>
                    <div field="ctime">{$vo.ctime}</div>
            </div>
            </volist>
        </div>
    </div>
</div>
</div>
</div>

<script type="text/javascript" src="__JS__/jq_datetimepicker/laydate.js"></script>
<script>
    $(".scroll-table .tbody").scroll(function(){
        $(".scroll-table .thead").scrollLeft($(this).scrollLeft());
    });
</script>
<script>
    function action_export() {
        $.ajax({
            url:"/admin/dingdan/ajax_export",
            type:"post",
            data:$("#search-form").serialize(),
            success:function(data){
                console.log(data);
                if (data.status == 1) {
                    location.href = data.info;
                }else{
                    alert("下载失败");
                }
            }
        });
    }

    //导出excel
    function action_export2() {
        var dataIds = new Array();
        $(".checkbox").each(function(){ //由于复选框一般选中的是多个,所以可以循环输出
            if($(this).is(":checked")){
                dataIds.push( parseInt($(this).attr("data-id")));
            }
        });

        var context = fn_GetContext();
        context.ids = dataIds.join();
        context.field = $("select[name=field]").val();

        var url = "";
        for(var k in context){
            url += k + "=" + context[k] + "&";
        }
        location.href = '/admin/dingdan/export?' + url;
    }
</script>
<script src="__JS__/dingdan.js?v=0.5" type="text/javascript" ></script>
<include file="Public:footer" />

